package ch.be.coop.unterhaltLaden.presentation.framesPanels;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

import ch.be.coop.unterhaltLaden.busines.Engine;

public class TitlePanel extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public TitlePanel(Engine engine) {

		this.setPreferredSize(new Dimension(800, 60));
		this.setLayout(new BorderLayout());

		this.add(new LogoPanel(), BorderLayout.EAST);
		this.add(new TextPanel(), BorderLayout.WEST);

		this.setVisible(true);

	}

	private class LogoPanel extends JPanel {

		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		public LogoPanel() {
			this.setPreferredSize(new Dimension(200, 60));
			
			this.setLayout(new FlowLayout());
			Icon _icon = new ImageIcon("Logo_coop.gif");
			JLabel _label = new JLabel(_icon);
			this.add(_label);
		}
	}

	private class TextPanel extends JPanel {

		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		private JLabel label;
		private Font font;

		public TextPanel() {
			this.setLayout(new FlowLayout());
			this.label = new JLabel("Coop Unterhalt");

			font = new Font("Arial Bold", Font.BOLD, 36);
			this.label.setFont(font);
			this.add(label);
		}
	}

}
